package ym.ecrm.core.dao.systemManagement.impl;

import java.util.List;

import ym.ecrm.core.dao.base.impl.HibernateEntityDAO;
import ym.ecrm.core.dao.systemManagement.IDataDictioinaryDAO;
import ym.ecrm.core.domain.systemManagement.DataDictionary;

public class HibernateDataDictionaryDAO extends
		HibernateEntityDAO<DataDictionary> implements IDataDictioinaryDAO {

	//@Override
	public List<DataDictionary> findDataByType(byte type) {
		String hql = "from DataDict ionary d where d.type = :type";
		return getHibernateTemplate().findByNamedParam(hql, "type", type);
	}

	//@Override
	public List<DataDictionary> findDataByParentId(long parentId) {
		String hql = "from DataDictionary d where d.parent.id = :parentId";
		return getHibernateTemplate().findByNamedParam(hql, "parentId",
				parentId);
	}

}
